<template>
	<div class="role">
		<el-dialog title="查看详情" :visible="dialogFormVisible" :close-on-click-modal="false" width="700px" :before-close="handleClose">
			<div class="tab">
				<el-form :model="form" ref="baseForm" label-width="150px">
					<el-form-item label="账号">
						<el-input
							v-model="form.account"
							placeholder="请输入账号"
							:disabled="true"
						></el-input>
					</el-form-item>
					<el-form-item label="email">
						<el-input
							v-model="form.email"
							placeholder="请输入邮箱"
							:disabled="true"
						></el-input>
					</el-form-item>
					<el-form-item label="姓名">
						<el-input
							v-model="form.name"
							placeholder="请输入姓名"
							:disabled="true"
						></el-input>
					</el-form-item>
					<el-form-item label="电话">
						<el-input
							v-model="form.phone"
							placeholder="请输入电话"
							:disabled="true"
						></el-input>
					</el-form-item>

					<el-form-item label="角色">
						<el-select
							v-model="form.role"
							multiple
							placeholder="请选择"
							style="width:100%;"
							:disabled="true">
							<el-option
								v-for="item in options"
								:key="item.flag"
								:label="item.name"
								:value="item.flag">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="账号">
						<el-input
							v-model="form.status_show"
							placeholder="请输入账号"
							:disabled="true"></el-input>
					</el-form-item>
				</el-form>
			</div>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
			</div>
		</el-dialog>
	</div>
</template>

<script>
import { getHeader } from '@/app.config'
export default {
	name: 'retestTask',
	data(){
		return {
			dialogFormVisible:false,
			form:{},
			options:[]
		}
	},
	created() {

	},
	methods:{
		handleClose(){
			this.dialogFormVisible = false
		},
		initData(data){
			var source = `${process.env.VUE_APP_KANBAN_HOST}/api/v1/user/${data}`;
			this.$axios.get(source, {headers: getHeader()})
				.then((response) => {
					if (response.status == 200) {
						console.log(response.data.data,34343)
						this.form = response.data.data
					}
				})
				.catch((err) => {
					console.log(err);
				});

			var source1 = `${process.env.VUE_APP_KANBAN_HOST}/api/v1/role`;
			this.$axios.get(source1, {headers: getHeader()})
				.then((response) => {
					if (response.status == 200) {
						console.log(response,12121)
						this.options = response.data.data
					}
				})
				.catch((err) => {
					console.log(err);
				});
		}
	}

}
</script>

<style lang="scss" scoped>
.role{
	.tab{
		width: 560px;
		//margin: 0 0 0 40px;
	}
}
</style>
